TableDeleting
申请删除表
请求地址
POST
http://OmsAddress/app/newoms.php/webservice/business/table/deleting?cmd=10005&ip-type=webservicerest&access-token=AccessTokenVal
POST请求参数说明
参数名称 | 数据类型 | 说明 | 是否必填字段 | 备注 |
---|---|---|---|---|
app_id | 整型 | 删除的表所在的业务id | 是 | |
zone_id | 整型 | 删除的表所在的游戏区id | 是 | |
table_name | 字符串 | 删除的表的表名 | 是 | |
auto_approve | 整型(0或1) | 是否自动审核删除表申请(表所在集群允许自动审核表删除申请) | 否,默认不自动审核 | |
auto_exec_trans | 整型(0或1) | 是否执行自动审核删除表申请后,生成清理表事务(表所在的集群允许自动执行删除表事务,auto_approve=1时,auto_exec_trans=1才有效) | 否,默认不自动执行 | |
attention_man | 字符串 | 用分号";"分隔关注人,关注人可执行此单据任务,字段最大长度为200 | 否 |
Data参数
使用json格式表示记录相关信息,示例如下:
{
"app_id": 2,
"zone_id": 3,
"table_name": "test_table_generic_modify",
"auto_approve": 0,
"auto_exec_trans": 0
}
返回语法
返回参数说明
参数名称 | 数据类型 | 说明 | 备注 |
---|---|---|---|
apply | json | ret:表示是否申请成功,0表示成功;其他表示失败 msg:表示ret不等于0时的错误信息 info:申请成功的删除表单据,其中uid表示单据id,审核时需要 | |
check | json | ret:表示是否审核成功,0表示成功;其他表示失败 msg:表示ret不等于0时的错误信息 info:其中trans_id表示生成的删除表的事务,set_id表示事务所在的集群(表所在的集群) |
请求示例
通过 curl 方法发起请求
命令中的参数请参考本页中的“POST请求参数说明”,access-token的获取方法详见:获取access-token
curl -H "Content-type: application/json" -X "POST" -d '{
"app_id": 2,
"zone_id": 3,
"table_name": "test_table_generic_modify",
"auto_approve": 0,
"auto_exec_trans": 0
}' http://omsaddress/app/newoms.php/webservice/business/table/deleting?cmd=10005&ip-type=webservicerest&access-token=<access-token>
返回示例
成功返回示例
http请求的Status=200
{
"apply": {
"ret": 0,
"msg": "success to apply delete table",
"info": {
"app_id": 2,
"app_name": "t_app",
"set_id": 126,
"zone_list": "3",
"table_name": "test_table_generic_modify",
"table_type": 0,
"estimated_write_load": 0,
"estimated_read_load": 0,
"type": "xml",
"table_maxnum": 0,
"write_time": "2017-03-02 22:10:55",
"apply_type": 1,
"key_avarage_record_size": 1,
"value_avarage_record_size": 1,
"compress": 0,
"active_record_num": "0",
"total_record_num": "3",
"memo": "",
"tdr": "-1",
"pcu": 1,
"relationship_chain_interval": 60,
"relationship_chain_count": 1,
"index_count": 1,
"read_index_interval": 60,
"read_index_count": 1,
"read_interval": 60,
"write_interval": 60,
"calc_resource_type": 2,
"dm_ratio": 5,
"user": "tcaplus",
"job_id": "43",
"id": 116
}
}
}
错误返回
http请求的Status!=200
{
"name": "Unauthorized",
"message": "You are requesting with an invalid credential.",
"code": 0,
"status": 401,
"type": "yii\\web UnauthorizedHttpException"
}
{
"apply": {
"ret": -1,
"msg": "table_name:已经申请其他表操作 app:2 zone:3 table_name:test_table_generic_modify apply id:116 apply type:1 error type:1",
"info": null
}
}